package com.macro.mall.common.constant.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @Description: 云服务商
 * @Author: alan
 * @Date: 2019/7/13 19:21
 */
@Getter
@AllArgsConstructor
public enum OssCloudServiceEnum {
	/**
	 * 七牛云
	 */
	QINIU(1, "七牛云","storage_qiniouyun"),
	/**
	 * 阿里云
	 */
	ALIYUN(2, "阿里云","storage_aliyun"),
	/**
	 * 腾讯云
	 */
	QCLOUD(3, "腾讯云","storage_tencent_cloud"),

    /**
     * MINIO
     */
    MINIO(4, "自己搭建的MINIO","storage_minio"),

    ;

	/**
	 * 类型
	 */
	private Integer type;
	/**
	 * 描述
	 */
	private String description;

    /**
     * code
     */
    private String code;

    /**
     * 通过type 获取枚举
     * @param type 类型
     * @return  OssCloudServiceEnum
     */
    public static OssCloudServiceEnum  getEnumByType(Integer type){
        for(OssCloudServiceEnum item : OssCloudServiceEnum.values()){
            if(item.getType().equals(type)){
                return item;
            }
        }
        return null;
    }


}
